package com.hsy.crm.web.domain.cm;

import java.io.Serializable;

public class Unified<T> implements Serializable {

    private int result = 0;

    private T data;

    public Unified(){}

    private Unified(T t){
        this.data = t;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean success() {
        return this.result == 0;
    }

    public static <A> Unified<A> create(Class<A> c) {
        return new Unified<A>();
    }

    public static <T> Unified<T> newInstance(T t) {
        return new Unified(t);
    }

    public static <T> Unified<T> newInstance() {
        return new Unified();
    }
}
